package com.zkthink.ceres.applet.server.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zkthink.base.R;
import com.zkthink.ceres.applet.common.domin.PageDate;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zkthink.ceres.applet.server.mapper.PcServerCategoryMapper;
import com.zkthink.ceres.applet.server.domain.entity.PcServerCategory;
import com.zkthink.ceres.applet.server.service.PcServerCategoryService;
/**

@Author cmz
@Date 2024-04-28 14:00
*/
@Service
public class PcServerCategoryServiceImpl extends ServiceImpl<PcServerCategoryMapper, PcServerCategory> implements PcServerCategoryService{
    @Resource
    private PcServerCategoryMapper pcServerCategoryMapper;

    @Override
    public R findByPage(PageDate pageDate) {
        QueryWrapper<PcServerCategory> pcServerCategoryQueryWrapper = new QueryWrapper<>();
        pcServerCategoryQueryWrapper.like("server_name",pageDate.getKeyword());
        Page<PcServerCategory> userPage = new Page<>(pageDate.getPageNum() , pageDate.getPageSize());
        Page<PcServerCategory> pcServerCategoryPage = pcServerCategoryMapper.selectPage(userPage, pcServerCategoryQueryWrapper);
        return R.success(pcServerCategoryPage);
    }
}
